home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C# & Game Programming - A…er's Guide (2nd Edition)
/
Buono 2nd Ed.iso
/
Chapter2
/
2.4
/
2.4.cs
next >
Wrap
Text File
|
2004-08-31
|
559b
|
22 lines
/* The if-else statement. */
using System;
namespace Chapter2 {
class Class1 {
static void Main() {
string input;
double Answer;
Console.Write("1 + 1.5 = ");
input = Console.ReadLine();
Answer = double.Parse(input);
if (Answer == 2.5)
Console.WriteLine("\n That is correct!\n");
else
Console.WriteLine("\n Wrong!!!\n");
}
}
}